package com.ftcs.service;

import com.ftcs.controller.common.request.TodoTasksRequest;
import com.ftcs.entity.LeaveApply;
import com.ftcs.model.LeaveTaskDTO;
import org.activiti.engine.history.HistoricActivityInstance;
import org.activiti.engine.impl.persistence.entity.ProcessDefinitionEntity;

import java.util.List;
import java.util.Map;

public interface LeaveService {
    /**
     * 开启流程实例
     *
     * @param apply
     * @param userid
     * @param variables
     * @return
     */
    String startWorkflow(LeaveApply apply, String userid, String proDefName, Map<String, Object> variables);

    /**
     * 待办任务
     *
     * @param request
     * @return
     */
    LeaveTaskDTO listTodoTasks(TodoTasksRequest request);

    LeaveApply getLeaveApply(int id);


    /**
     * 完成销假，汇报
     *
     * @param taskid
     * @param realstart_time
     * @param realend_time
     */
    void completeReportBack(String taskid, String realstart_time, String realend_time);

    void updateComplete(String taskid, LeaveApply leave, String reappply);

    List<String> getHighLightedFlows(ProcessDefinitionEntity deployedProcessDefinition,
                                     List<HistoricActivityInstance> historicActivityInstances);
}
